<?php

namespace app\supplier\service\statistics;

use app\supplier\model\sms\Sms as SmsModel;

class SmsService
{
    private $shop_supplier_id;

    public function __construct($shop_supplier_id)
    {
        $this->shop_supplier_id = $shop_supplier_id;
    }

    /**
     * 获取订单商品数据
     */
    private function getSmsData($startDate, $endDate)
    {
        return (new SmsModel)->getSmsData($startDate, $endDate, $this->shop_supplier_id);
    }

    public function getSmsDataByDate($days)
    {
        $data = [];
        foreach ($days as $day) {
            $data[] = [
                'day' => $day,
                'total_num' => $this->getSmsData($day, null)
            ];
        }
        return $data;
    }
}